<!-- You can start editing here. -->
{% if entry.allow_comment %}
<div class="box post-blog-comments" id="comments">
	<div class="content border">
		{% if entry.allow_comment %}
		<h2>
			{{entry.comments.count}}条评论
		</h2>
		{%endif%} {% for comment in entry.comments %}
		<div id="comment-{{comment.key.id}}" class="fl ar">
			<div class="pic">
				<img width="50" height="50" class="avatar avatar-50 photo"
					src="{{comment.gravatar_url}}" alt="">
			</div>
			<div class="comm-name">
				{%if comment.weburl %}
				<a href="{{comment.weburl}}" target="_blank">{{comment.author}}</a>
				{% else %}{{comment.author}}{%endif%}
			</div>
			<div class="comm-date">
				<small><em>{{comment.date.date|datetz:"Y-m-d"}} </em>
				</small>
			</div>
		</div>
		<div class="fr">
			<div class="box2  {%cycle alt1,alt %}">
				{{comment.content}}
			</div>
			<!--/box2 -->
		</div>
		<div class="clr"></div>
		{% endfor %}
	</div>
	<!--/content -->
	<div class="clr"></div>
	<!--Maybe 评论分页{comments_nav.nav} -->
</div>
<!--/box -->
<div id="respond" class="box post-blog-comments">
	<div class="content border">
		<h2>
			嘿！想说什么吗？
		</h2>
		<div class="fl">
			<div class="pic">
			</div>
		</div>
		<div class="fr">
			<form action="/post_comment" method="post" id="commentform">
				<fieldset class="message">
					<div>
						您的昵称：<input name="author" id="author" type="text" value="" />
					</div>
					<div>
						电子邮箱：<input name="email" id="email" type="text" value="123456789@qq.com"
							onclick="this.value='';" />
					</div>
					<div>
						您的网站：<input name="url" id="url" type="text" value=""/>
					</div>
					<div>
						{%ifequal blog.comment_check_type 1%}
						<p id="checkarea">
							<iframe src="/checkcode/"
								style="width: 80px; height: 20px; border: 0;" SCROLLING=no></iframe>
							<input type="text" name="checkret" id="checkret" value=""
								size="5" tabindex="4" />
						</p>
						{%endifequal%} {%ifequal blog.comment_check_type 2%}
						<div id="checkarea" style="padding-bottom: 15px">
							<div style="float: left; margin-right: 8px;">
								<label for="checkret">
									<small>Checkcode:</small>
								</label>
								<input type="text" name="checkret" id="checkret" value=""
									size="5" tabindex="4" />
							</div>
							<img id='checkimg' src='/checkimg/'
								style="border: 0px; padding: 0px;" title='Click to change image'
								onclick="reloadCheckImage();" />
						</div>
						{%endifequal%}
					</div>
					<div class="textarea">
						<textarea name="comment" id="comment" cols="" rows=""></textarea>
					</div>

					<div class="submit commentBtn">
						<input name="submit" id="submit" type="submit" value="提交"
							class="btn" />
					</div>
					<div class="notice">
						* 昵称、评论必填
					</div>
					<input type="hidden" name="key" value="{{entry.key}}" />
					<!--  <input type="hidden" name="useajax" value="1" />-->
				</fieldset>
			</form>
<script type="text/javascript" src="/static/js/jquery.cookie.js"></script>
<script>
    commentuser=$.cookie('comment_user');
       if (commentuser)
       {
         //[user,email,url]=commentuser.split('#@#');
         var tuple=commentuser.split('#@#');
        var user,email,url;
        user=tuple[0];
        email=tuple[1];
        url=tuple[2];
         $('#author').val(user);
         $('#email').val(email);
         $('#url').val(url);
       }

  $('#commentform').submit(function(){
         var form = this;
           if (form.author)
  		   {

      			 if (!form.author.value)
          		 {
          		  alert('请填写昵称');
          		  form.author.focus();
          		  return false;
          		 }
          		 if (!form.email.value)
          		 {
          			$('#email').val('000000000@qq.com');
          		 }
	       }

      		 if (!form.comment.value)
      		 {
      		 	alert('你的回复还是空的。。。');
      		 	form.comment.focus();
      		 	return false;
      		 }

      		 return true;
  });
</script>
		</div>
		<div class="clr"></div>
	</div>
	<!--/content -->
</div>
<!--/box -->
{% else %}
<p class="nocomments">
	评论已关闭
</p>
{% endif %}
